package me.zhengjie.modules.management.rest.admin;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.management.domain.MrConferencePurpose;
import me.zhengjie.modules.management.domain.Pageable;
import me.zhengjie.modules.management.service.MrConferencePurposeService;
import me.zhengjie.modules.management.service.dto.MrConferencePurposeCriteria;
import me.zhengjie.modules.management.service.dto.MrConferencePurposeDto;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: eladmin
 * @description: 目的控制层
 * @author: ming.cao
 * @create: 2020-12-05 15:08
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "MR:会议室用途管理")
@RequestMapping("/api/conferencePurpose")
public class MrConferencePurposeController {

    private final MrConferencePurposeService mrConferencePurposeService;

    @GetMapping
    @Log("获取所有会议室用途信息")
    @ApiOperation("获取所有会议室用途信息")
    public Object getAllList(MrConferencePurposeCriteria criteria, Pageable pageable){
      return  mrConferencePurposeService.getAllList(criteria ,pageable);
    }

    @PostMapping
    @Log("新增会议室用途信息")
    @ApiOperation("新增会议室用途信息")
    public void addConferencePurpose(@RequestBody MrConferencePurpose mrConferencePurpose){
        mrConferencePurposeService.addConferencePurpose2(mrConferencePurpose);
    }

    @PutMapping
    @Log("修改会议室用途信息")
    @ApiOperation("修改会议室用途信息")
    public void updateConferenceRoomEquips(@RequestBody MrConferencePurpose mrConferencePurpose){
        mrConferencePurposeService.updateConferencePurpose2(mrConferencePurpose);
    }

    @DeleteMapping
    @Log("删除会议室用途信息")
    @ApiOperation("删除会议室用途信息")
    public void delConferenceRoomEquips(@RequestBody List<Integer> ids){
        mrConferencePurposeService.delConferencePurpose(ids);
    }

    @GetMapping("/getPurposeById")
    @Log("获取id获取会议室用途信息")
    @ApiOperation("获取id获取会议室用途信息")
    public Object getConferencePurposeById(Integer id){
        return mrConferencePurposeService.getMrConferencePurposeById2(id);
    }

/*    @GetMapping("/getForShow")
    @Log("获取用途展示信息")
    @ApiOperation("获取展示展示信息")
    public Object getAllListForShow(MrConferencePurposeCriteria criteria, Pageable pageable){
        return  mrConferencePurposeService.getAllListForShow(criteria ,pageable);
    }*/

}
